#!/bin/bash 

args=(
	
	
  -device e1000,netdev=net0,mac=aa:51:00:00:02:00 \
  -netdev tap,id=net0,ifname=cna2_manage,script="./add_to_manage_bridge.sh" \
  -device e1000,netdev=net1,mac=aa:51:00:00:02:01 \
  -netdev tap,id=net1,ifname=cna2_storage,script="./add_to_business_bridge.sh" \

  -device e1000,netdev=net2,mac=aa:51:00:00:02:02 \
  -netdev tap,id=net2,ifname=cna2_2,script=no \

  -device e1000,netdev=net3,mac=aa:51:00:00:02:03 \
  -netdev tap,id=net3,ifname=cna2_3,script=no \
  -device e1000,netdev=net4,mac=aa:51:00:00:02:04 \
  -netdev tap,id=net4,ifname=cna2_4,script=no 


  -device virtio-net-pci,netdev=n1 \
  -netdev user,id=n1,hostfwd=tcp::5222-:22,hostfwd=tcp::28888-:80,hostfwd=tcp::18443-:443 \
)
qemu-system-x86_64 \
  -enable-kvm \
  -cpu host \
  -smp 2 \
  -m 8G \
  -machine q35,accel=kvm \
  -drive file=./firmware_cna/cna_2.qcow2,if=virtio \
  -vnc 0.0.0.0:31,password=off \
  -daemonize \
  -cdrom ./FusionCompute_CNA-8.0.0-X86_64.iso \
  ${args[@]}
